package org.picommo.common;

import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Element;


public class Frame {
	
	@Element
	private final Vec2 position;

	@Attribute
	private final Direction direction;
	
	
	public Frame() {
		this(Vec2.getZero(), Direction.none);
	}
	
	public Frame(Vec2 position, Direction direction) {
		super();
		this.direction = direction;
		this.position = position;
	}

	public Vec2 getPosition() {
		return position;
	}

	public Direction getDirection() {
		return direction;
	}
	
	
	@Override
	public String toString() {
		return "[" + position.toString() + " " + direction.toString() + "]";
	}
	
	@Override
	public boolean equals(Object obj) {
		if(!(obj instanceof Frame)) {
			return false;
		}
		Frame f = (Frame)obj;
		return position.equals(f.position) && direction.equals(f.direction);
	}
}
